package com.atguigu.gmall.all.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author mqx
 * @date 2020-12-14 09:27:35
 */
@Controller
public class PassportController {

    // http://passport.gmall.com/login.html?originUrl=http://www.gmall.com/
        @GetMapping("login.html")
        public String login(HttpServletRequest request){
            //  获取用户从哪里点击登录的url
            String originUrl = request.getParameter("originUrl");
            //  login.html 需要获取 originUrl
            request.setAttribute("originUrl",originUrl);
            // 返回登录页面 login.html
            return "login";
    }
}
